package com.lc.common;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ControllerHandler {

    @ResponseBody
    @ExceptionHandler(Exception.class)
    HttpResult<?> exceptionHandle(Exception exception) {
        //统一处理异常
        return HttpResult.error(exception.getMessage());
    }
}
